package com.cx.dbtablelist.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 正则表达式帮助类
 * @date : 2014-2-14
 * @author caoxu-yiyang@qq.com
 */
public abstract  class RegexUtils {

	public static List<String> match(String value, String regex){
		if(value == null){
			return null;
		}
		Pattern pattern = Pattern.compile(regex);
		Matcher matcher = pattern.matcher(value);
		
		List<String> resultList =new ArrayList<String>();
		while(matcher.find()){
			resultList.add(matcher.group());
		}
		return resultList;
	}
}
